<?php
require '../config.php';
$resultset = mysql_query("select idtarifas,minutos,dinero from tarifas",$conexion);
if(!$resultset)
{
    mysql_close();
    echo json_encode('error en el query: ' . mysql_error());
}
elseif(!mysql_num_rows($resultset))
{
    mysql_close();
    echo json_encode('Sin resultados');
}
else
{
		
			
			echo   "<table class='table table-bordered'>";
			echo   "<tr>";
			echo   "<th>Minutos</th><th>Dinero</th><th>Selecci&oacute;n</th>";
			echo   "</tr>";
			echo   "<tbody>";
			$aux=0;
			while($row = mysql_fetch_assoc($resultset))
			{
				if($aux==0){
					$color="#FFFFFF";
					$aux=1;
				}else{
					$color="#F9F9F9";
					$aux=0;
				}
				echo ("<tr bgcolor='".$color."'>");
				echo   "<td>".$row['minutos']."</td>";
				echo   "<td>$".$row['dinero']."</td>";
				echo   "<td><input type='radio' name='dineros' id ='".$row['idtarifas']."'></td>";
				echo   "</tr>";
			}
			echo("<tr class='success'>");
			echo   "<td>Otro:</td>";
			echo   "<td><strong>$</strong> <input type='text' id ='txtotro' onkeyUp='return ValNumero(this);'></td>";
			echo   "<td><input type='radio' name='dineros' id='otro'></td>";
			echo   "</tr>";
			echo   "</tbody>";
			echo   "</table>";
			mysql_close();
			
		
}

?>